<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input type="file" id="file1">
    <img src="" id="myImg" alt="">
    <script>
        let file= document.getElementById("file1")

        file.onchange = function() {
            // let reader = new FileReader();
            // reader.onload = function(){
            //     let arr = new Uint8Array(this.result)
            //     console.log('arr :', arr);
            // }

            // reader.readAsArrayBuffer(file.files[0]);
            let url = URL.createObjectURL(file.files[0]);
            console.log('url :', url);
            let myImg = document.getElementById("myImg");
            myImg.src = url;
        }


    </script>
    
</body>
</html>